home *** CD-ROM | disk | FTP | other *** search
- package engine.levelData
- {
- import copy.CopyBank;
- import engine.WorldScene;
- import engine.dynamicObjects.*;
-
- public class Level_08 extends LevelData
- {
-
-
- public function Level_08()
- {
- super();
- _goalParameters = new Array();
- }
-
- override public function buildLevel() : *
- {
- var i:* = undefined;
- var rNum:* = undefined;
- var podium:* = undefined;
- var cage:* = undefined;
- var px:Number = NaN;
- var indian:* = undefined;
- var fuelIcon:* = undefined;
- var goalObj:Object = null;
- var missionObj:Object = null;
- super.buildLevel();
- rNum = Math.random();
- for(i = 0; i < 5; i++)
- {
- rNum = Math.random();
- px = 150 + Math.random() * 75 + i * 160;
- if(rNum < 0.3)
- {
- podium = new Podium("tall");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 568;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 568;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- if(rNum >= 0.3 && rNum < 0.6)
- {
- podium = new Podium("med");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 582;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 582;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- if(rNum >= 0.6)
- {
- podium = new Podium("short");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 604;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 604;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- }
- for(i = 0; i < 5; i++)
- {
- rNum = Math.random();
- px = 1200 + Math.random() * 75 + i * 160;
- if(rNum < 0.3)
- {
- podium = new Podium("tall");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 568;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 568;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- if(rNum >= 0.3 && rNum < 0.6)
- {
- podium = new Podium("med");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 582;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 582;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- if(rNum >= 0.6)
- {
- podium = new Podium("short");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 604;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 604;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- }
- for(i = 0; i < 5; i++)
- {
- rNum = Math.random();
- px = 2300 + Math.random() * 75 + i * 160;
- if(rNum < 0.3)
- {
- podium = new Podium("tall");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 568;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 568;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- if(rNum >= 0.3 && rNum < 0.6)
- {
- podium = new Podium("med");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 582;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 582;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- if(rNum >= 0.6)
- {
- podium = new Podium("short");
- podium.x = px;
- podium.y = 700;
- WorldScene.Instance.GameplayObjects.push(podium);
- cage = new Cage1();
- cage.x = podium.x - 16;
- cage.y = 604;
- WorldScene.Instance.GameplayObjects.push(cage);
- WorldScene.Instance.Cages.push(cage);
- if(i > 0)
- {
- indian = new Indian();
- indian.x = podium.x + 16;
- if(i > 2)
- {
- indian.LobMode = true;
- }
- indian.y = -8 + 604;
- WorldScene.Instance.GameplayObjects.push(indian);
- WorldScene.Instance.Indians.push(indian);
- }
- }
- }
- fuelIcon = new FuelIcon();
- fuelIcon.x = 4000;
- fuelIcon.y = 2000;
- WorldScene.Instance.GameplayObjects.push(fuelIcon);
- fuelIcon = new FuelIcon();
- fuelIcon.x = 5000;
- fuelIcon.y = 2000;
- WorldScene.Instance.GameplayObjects.push(fuelIcon);
- _missionDescription = CopyBank.Instance.MissionDesc_Cages;
- goalObj = {
- "Type":"Cage",
- "Count":15
- };
- _goalParameters.push(goalObj);
- missionObj = {
- "Description":_missionDescription,
- "BoundsX":_missionBoundsX,
- "BoundsHint":_missionBoundsHint,
- "GoalParamaters":_goalParameters,
- "PrimaryGoalType":"Cages",
- "StartLoc":{
- "x":400,
- "y":400
- }
- };
- WorldScene.Instance.setMissionDetails(missionObj);
- }
- }
- }
-